<template>
	<view>
		<view class="header status_bar" :class="scrrol == true ? 'scrrolHeader' : ''">
			<view class="text" :class="scrrol == true ? 'scrrolHeader' : ''">首頁</view>
			<view class="link_box">
				<input disabled="ture" type="text" value="" placeholder="鏈接錢包" placeholder-style="color:#fff;"
					v-model="link" />
				<view class="copy iconfont icon-fuzhi" @tap="copyText"></view>
			</view>
			<view class="message iconfont icon-tongzhi">
				<view class="round"></view>
			</view>
			<picker @change="choiceLang" :value="langIndex" :range="Lang.lang('langData')" :range-key="'name'">
				<view class="language" v-if="lang == 'en'">EN</view>
				<view class="language" v-else>CN</view>
			</picker>
		</view>		
		<view class="clear_box"></view>
		
		<view class="page_content"></view>


	</view>
</template>

<script>
	export default {
		data() {
			return {
				lang: 'en',
				link: '',
				pupu: false,
				scrrol: false,
				info: '',				
			}
		},
		onLoad() {

		},
		onShow() {
			let that = this;
			//that.loadData();
		},
		methods: {
			setMenuLang() {
				let that = this;
				uni.setTabBarItem(this.Lang.lang('indexMenu')[0]);
				uni.setTabBarItem(this.Lang.lang('indexMenu')[1]);
				uni.setTabBarItem(this.Lang.lang('indexMenu')[2]);
				uni.setTabBarItem(this.Lang.lang('indexMenu')[3]);
			},
			// 复制文本到剪贴板
			copyText() {
				let that = this;
				uni.setClipboardData({
					data: that.link,
					success: function() {
						console.log('复制成功');
						// 可以添加用户友好的提示，例如使用uni.showToast提示复制成功
						uni.showToast({
							title: '复制成功',
							icon: 'none',
							duration: 2000
						});
					},
					fail: function() {
						console.error('复制失败');
						// 可以添加错误处理或用户友好的提示
					}
				});
			},
			loadData() {
				let that = this;
				that.Net._get('home', {}, res => {
					if (res.code == 200) {
						//console.log(res);

					}
				});
			},
			backPage() {
				uni.navigateBack({});
			},
			gotopage(e) {
				let url = e.currentTarget.dataset.url;
				uni.navigateTo({
					url: url
				});
			},
		},
		onPageScroll: function(Object) {
			//console.log(Object.scrollTop); //实时获取到滚动的值
			if (Object.scrollTop > 28) {
				this.scrrol = true;
				/* #ifdef APP-PLUS */
				/* #endif */
			} else if (Object.scrollTop < 28) {
				this.scrrol = false;
				/* #ifdef APP-PLUS */
				/* #endif */
			}
		},
	}
</script>

<style>
	.scrrolHeader {
		width: 100%;
		background-color: #1A1A1A !important;
	
	}
	
	.page_content{
		width: 92%;
		margin: 0 auto;
	}

	
</style>